<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul{
            list-style: none;
        }
        li{
            width: 200px;
            height: 50px;
        }
        li:nth-child(odd){
            background-color: yellowgreen;
        }
        li:nth-child(even){
            background-color: red;
        }
    </style>
</head>
<body>
    <ul id='container'>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
    </ul>
    <script>
        document.getElementById('container').addEventListener('click',(e)=>{
            e.target.style.backgroundColor='blue'
            console.log(e.target.style.backgroundColor)
        })
    </script>
</body>
</html>